﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <title>保存Word首页为图片</title>

</head>
<body>
	<script type="text/javascript">
		function Save() {
			var saveUrl = "/SaveFirstPageAsImg/SaveDoc";
			pageofficectrl.SaveFilePage = saveUrl;
			pageofficectrl.WebSave();
		}

		function SaveFirstAsImg() {
			var saveUrl = "/SaveFirstPageAsImg/SaveDoc";
			pageofficectrl.SaveFilePage = saveUrl;
			pageofficectrl.WebSaveAsImage();
			alert('图片被保存到“SaveFirstPageAsImg/images/”目录下');
		}

		function OnPageOfficeCtrlInit() {
			pageofficectrl.AddCustomToolButton("保存", "Save()", 1);
			pageofficectrl.AddCustomToolButton("保存首页为图片", "SaveFirstAsImg()", 1);
		}
	</script>
    <div><img id="img1" /></div>
    <div style="width:auto; height:900px;">
        @Html.Raw(ViewBag.poCtrl)
    </div>
</body>
</html>